Triplestores and subject-predicate-object databases store “triples” each representing a relationship between a pair of things. For example, such a database may contain the triple (Sandra, manages, Anthony). In this example, “Sandra” is the subject of the triple, “manages” is the predicate of the triple, and “Anthony” is the object of the triple. The triple represents a relationship between Sandra and Anthony in which Sandra is Anthony's manager.
Graph databases organize information by connecting pairs of nodes each with an edge. A graph database can be used to represent the contents of a triplestore or subject-predicate-object database; in particular, each triple is represented by establishing a first node corresponding to the subject of the triple, establishing a second node corresponding to the object of the triple, and establishing an edge from the first node to the second node corresponding to the predicate of the triple. In some cases, graph databases are used to represent the values of properties for entities: a first node represents an entity, such as a particular book; an edge exiting the first node represents a property identity, such as a title property; and a second node entered by the edge represents a value of the property represented by the edge for the entity represented by the first node, such as the title of the book represented by the first node.
Graph databases, subject-predicate-object databases, and triplestores have many similarities; can be used in many of the same situations; and can often be straightforwardly transformed between each other. They are favored for their flexibility, able to dynamically consume and organize data of arbitrary complexity without requiring that a structure be defined for the data in advance of its loading.